package com.attilax.encry;

import java.util.Map;

import org.openqa.selenium.NotFoundException;

import com.attilax.json.AtiJson;
import com.attilax.secury.MD5;
import com.attilax.sql.EmptyRzt;

public class rsaTest {
	
	public static void main(String[] args) throws Exception {
		//aa();
		try {
			t();
		} catch (Exception e) {
			String s=AtiJson.toJson(e);
			System.out.println(s);
		}
		
	}

	private static void t() {
		
		try {
			t2();
		} catch (Exception e) {
			throw new RuntimeException("biz ex", e);
		}
		
		
	}

	private static void t2() throws EmptyRzt {
		if("1".equals("1"))
			throw new EmptyRzt("mmmm1");
		
	}

	private static void aa() {
		//pubkey_md5：91B86555CC85C0831746DE123B713FD4
		//pubkey_md5：AB77AFE7AF3D1690752BAF5D3894C7B1
			//pubkey_md5：4C15B9417193977076A52FCA063260C7
		//初始化密钥  MFwwDQYJKoZIhvcNAQE  ...ECAwEAAQ==
		//生成密钥对
		RSACoder rsaCoder = new RSACoder();
		Map<String,Object> keyMap= rsaCoder.initKey_fixKeyM2("fix_seed");
		//String pubkey_md5=MD5.getMD5(keyMap.get(RSACoder.PUBLIC_KEY).toString());
	//	System.out.println("pubkey_md5："+pubkey_md5);
		RSACoder.main(new String[]{"aa","c:\\0.txt","c:\\1.txt"});
		System.out.println(AtiJson.toJson(keyMap));
	//	System.out.println(com.attilax.encode.Base64.encode("pp".getBytes()));
	}

}
